<script>
$(document).ready(function(){
	loadDistrict('idProvince_start','idDistrict_start');
	loadDistrict('idProvince_end','idDistrict_end');
});
</script>
<div class="row-fluid">
	<div class="box span12">
		<div class="box-header" data-original-title>
			<h2>
				<i class="icon-edit"></i><span class="break"></span>Thông tin xe
				chạy
			</h2>
			<div class="box-icon">
				<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
			</div>
		</div>
		<div class="box-content">
			<form class="form-horizontal">
				<h2>Thông tin xe</h2>
				<hr>
				<fieldset>
				<div class="row-fluid">
				    <div class="span6">
					<div class="control-group">
						<label class="control-label">Tên nhà xe</label>
						<div class="controls">
						    <?php echo $this->formSelect("idTransportCompany",NULL,array("style"=>"max-width:150px"),$this->arr_transport)?>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Loại xe</label>
						<div class="controls">
							<?php echo $this->formSelect("KindOFCar",NULL,array("style"=>"max-width:150px"),array("1"=>"Giường nằm","2"=>"Ghế ngồi"));?>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Số chỗ ngồi</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Biển kiểm soát</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Số điện thoại 1</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Số điện thoại 2</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Giá vé toàn tuyến</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Thời gian chạy toàn tuyến</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Hình ảnh xe</label>
						<div class="controls">
							<input class=" focused" type="text">
						</div>
					</div>
					</div>
					<div class="span6">
					<div class="control-group">
						<label class="control-label">Là mô hình xe Bus?</label>
						<div class="controls">
							<input type="checkbox" id="inlineCheckbox1" value="option1">
						</div>
					</div>
					<div id="forOpBus">
    					<div class="control-group">
    						<label class="control-label">Số chuyến/ngày</label>
    						<div class="controls">
    							<?php echo $this->formText("")?>
    						</div>
    					</div>
    					<div class="control-group">
    						<label class="control-label">Khoảng thời gian giữa các chuyến</label>
    						<div class="controls">
    							<?php echo $this->formText("")?>
    						</div>
    					</div>
    					<div class="control-group">
    						<label class="control-label">Giờ chạy chuyến đầu tiên trong ngày</label>
    						<div class="controls">
    							<?php echo $this->formSelect("hour_TimeStartFromStartPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
    					        h
    					        <?php echo $this->formSelect("minute_TimeStartFromStartPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
    						</div>
    					</div>
    					<div class="control-group">
    						<label class="control-label">Giờ chạy chuyến cuối trong ngày</label>
    						<div class="controls">
    							<?php echo $this->formSelect("hour_TimeStartFromStartPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
					            h
					            <?php echo $this->formSelect("minute_TimeStartFromStartPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
    						</div>
    					</div>
					</div>
					</div><!-- end div bus -->
					</div>
					<h2>Thông tin lộ trình chi tiết</h2>
					<hr>
					<div class="row-fluid control-group">
					    <div class="span4">
					        <span>Tỉnh/TP đầu bến</span>
					        <?php 
					        foreach ($this->list_province as $province) $arr_province[$province['idProvince']]=$province['ProvinceName'];
					        ?>
					        <?php echo $this->formSelect("idProvince_start",NULL,array("style"=>"max-width:185px","onchange"=>"loadDistrict('idProvince_start','idDistrict_start')"),$arr_province)?>
					    </div>
					    <div class="span4">
					        <span>Huyện</span>
					        <?php echo $this->formSelect("idDistrict_start",NULL,array("style"=>"max-width:185px"),NULL)?>
					    </div>
					    <div class="span4">
					        <span>Giờ xuất bến</span>
					        <?php echo $this->formSelect("hour_TimeStartFromStartPoint",15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
					        h
					        <?php echo $this->formSelect("minute_TimeStartFromStartPoint",15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
					    </div>
					</div>
					<div class="row-fluid control-group">
					    <div class="span4">
					        <span>Tỉnh/TP cuối bến</span>
					        <?php echo $this->formSelect("idProvince_end",NULL,array("style"=>"max-width:185px","onchange"=>"loadDistrict('idProvince_end','idDistrict_end')"),$arr_province)?>
					    </div>
					    <div class="span4">
					        <span>Huyện</span>
					        <?php echo $this->formSelect("idDistrict_end",NULL,array("style"=>"max-width:185px"),NULL)?>
					    </div>
					    <div class="span4">
					        <span>Giờ tới bến</span>
					        <?php echo $this->formSelect("hour_TimeStartFromStartPoint",15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
					        h
					        <?php echo $this->formSelect("minute_TimeStartFromStartPoint",15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
					    </div>
					</div>
					<div><b>Đi qua các địa phương:</b> Việc đưa ra chi tiết lộ trình, thời gian, giá vé cho từng điểm đi qua sẽ giúp cho khách hàng tin tưởng hơn vào nhà xe</div>
					<!-- ROUTER -->
					<?php for($i=1;$i<=5;$i++){?>
					<script>
                    $(document).ready(function(){
                    	loadDistrict('idProvince_<?php echo $i?>','idDistrict_<?php echo $i?>');
                    	loadDistrict('idProvince_<?php echo $i?>','idDistrict_<?php echo $i?>');
                    });
                    </script>
					<div class="row-fluid control-group" id="router_<?php echo $i?>">
					    <div class="span2">
					        <label>Địa điểm <?php echo $i?></label>
					        <?php echo $this->formSelect("idProvince_".$i,NULL,array("style"=>"max-width:150px","onchange"=>"loadDistrict('idProvince_".$i."','idDistrict_".$i."')"),$arr_province)?>
					    </div>
					    <div class="span2">
					        <label>Huyện</label>
					        <?php echo $this->formSelect("idDistrict_".$i,NULL,array("style"=>"max-width:150px",NULL))?>
					    </div>
					    <div class="span2">
					        <label>Giờ đi qua điểm này</label>
					        <?php echo $this->formSelect("hour_FirstTimeToPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
					        h
					        <?php echo $this->formSelect("minute_FirstTimeToPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
					    </div>
					    <div class="span2">
					        <label>Giờ về qua điểm này</label>
					        <?php echo $this->formSelect("hour_BackTimeToPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_hour); ?>
					        h
					        <?php echo $this->formSelect("minute_BackTimeToPoint".$i,15,array("style"=>"max-width:55px"),$this->arr_minute); ?>
					    </div>
					    <div class="span3">
					        <label>Giá vé từ đầu bến tới điểm này</label>
					        <?php echo $this->formText("CostFromStartToThisPoint".$i,NULL,array("style"=>"max-width:150px;"))?>
					        <button class="btn btn-small btn-danger" type="button" onclick="$('#router_<?php echo $i?>').remove()">Xóa</button>
					    </div>
					</div>
					<?php }?>
					<button class="btn btn-large" onclick="addRouter()" type="button" id="btnAddRouter" data-loading-text="Xin chờ ...">Thêm địa điểm</button>
					<?php echo $this->formHidden("count_router",5)?>
					<!-- END ROUTER -->
				</fieldset>
				<div class="form-actions">
					<button type="submit" class="btn btn-primary">Save changes</button>
					<button class="btn">Cancel</button>
				</div>
		
		</div>
		</form>
	</div>
	<!--/span-->
</div>
